package com.yaolonga.itfc.manager.core.wifi;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: yaolong
 * @CreateTime: 2024-10-25  13:54
 * @Description: wifi信息
 * @Version: 1.0
 */
@Data
public class SSIDInfo {

    /**
     * 网卡名称
     */
    private String interfaceName;

    /**
     * ssid
     */
    private String ssid;

    /**
     * bssid信息
     */
    private List<BSSIDInfo> bssid = new ArrayList<>();


    /**
     * 加密方式
     */
    private String encryption;

    /**
     * 安全类型
     */
    private String secureType;

    /**
     * 网络类型
     */
    private String networkType;

    /**
     * state
     */
    private ConState state;


    public void addBssid(BSSIDInfo _bssid) {
        bssid.add(_bssid);
    }

    public ConState getConState() {
        return bssid.stream().filter(i -> i.getState().equals(ConState.connected)).findFirst()
                .map(BSSIDInfo::getState)
                .orElse(ConState.disconnect);
    }

}
